package com.coldchain.common.redis.properties;
import org.springframework.boot.context.properties.ConfigurationProperties;
/**
 * @ClassName RedisProperties
 * @Description TODO
 * @Author fangliai
 * @Date 2018/9/10 9:09
 * @Vesion 1
**/
@ConfigurationProperties("redisson")
public class RedisProperties {
    /**
     * 哨兵模式
     * redisconfig.masterName=mymaster
     * redisconfig.sentinelAddresses=10.47.91.83:26379,10.47.91.83:26380,10.47.91.83:26381
     */
    private String masterName;

    /**
     * 单机模式
     */
    private String address;

    /**
     * 哨兵模式必需
     */
    private String sentinelAddresses;
    /**
     * 命令等待超时，单位：毫秒
     */
    private Integer Timeout=3000;

    /**
     * 主节点连接池大小
     */
    private Integer masterConnectionPoolSize;

    /**
     * 主节点最小空闲连接数
     */
    private Integer masterConnectionMinimumIdleSize=32;

    /**
     * 从节点连接池大小
     */
    private Integer slaveConnectionPoolSize=64;

    /**
     * 从节点最小空闲连接数
     */
    private Integer slaveConnectionMinimumIdleSize=32;

    /**
     * 连接空闲超时，单位：毫秒
     */
    private Integer idleConnectionTimeout=10000;

    /**
     * 命令失败重试次数
     */
    private Integer retryAttempts=3;

    /**
     * 用于节点身份验证的密码
     */
    private String password;

    public String getMasterName() {
        return masterName;
    }

    public void setMasterName(String masterName) {
        this.masterName = masterName;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getSentinelAddresses() {
        return sentinelAddresses;
    }

    public void setSentinelAddresses(String sentinelAddresses) {
        this.sentinelAddresses = sentinelAddresses;
    }

    public Integer getTimeout() {
        return Timeout;
    }

    public void setTimeout(Integer timeout) {
        Timeout = timeout;
    }

    public Integer getMasterConnectionPoolSize() {
        return masterConnectionPoolSize;
    }

    public void setMasterConnectionPoolSize(Integer masterConnectionPoolSize) {
        this.masterConnectionPoolSize = masterConnectionPoolSize;
    }

    public Integer getMasterConnectionMinimumIdleSize() {
        return masterConnectionMinimumIdleSize;
    }

    public void setMasterConnectionMinimumIdleSize(Integer masterConnectionMinimumIdleSize) {
        this.masterConnectionMinimumIdleSize = masterConnectionMinimumIdleSize;
    }

    public Integer getSlaveConnectionPoolSize() {
        return slaveConnectionPoolSize;
    }

    public void setSlaveConnectionPoolSize(Integer slaveConnectionPoolSize) {
        this.slaveConnectionPoolSize = slaveConnectionPoolSize;
    }

    public Integer getSlaveConnectionMinimumIdleSize() {
        return slaveConnectionMinimumIdleSize;
    }

    public void setSlaveConnectionMinimumIdleSize(Integer slaveConnectionMinimumIdleSize) {
        this.slaveConnectionMinimumIdleSize = slaveConnectionMinimumIdleSize;
    }

    public Integer getIdleConnectionTimeout() {
        return idleConnectionTimeout;
    }

    public void setIdleConnectionTimeout(Integer idleConnectionTimeout) {
        this.idleConnectionTimeout = idleConnectionTimeout;
    }

    public Integer getRetryAttempts() {
        return retryAttempts;
    }

    public void setRetryAttempts(Integer retryAttempts) {
        this.retryAttempts = retryAttempts;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
}
